package com.zw.user.controller;

import com.zw.user.api.UsersApi;
import com.zw.user.model.User;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController implements UsersApi {
    /**
     * GET /users : Get all users
     * Returns a list of all users
     *
     * @return Successful operation (status code 200)
     */
    @Override
    public ResponseEntity<List<User>> usersGet() {
        return null;
    }

    /**
     * DELETE /users/{id} : Delete user
     * Deletes a user
     *
     * @param id (required)
     * @return User deleted (status code 204)
     * or User not found (status code 404)
     */
    @Override
    public ResponseEntity<Void> usersIdDelete(Long id) {
        return null;
    }

    /**
     * GET /users/{id} : Get user by ID
     * Returns a single user
     *
     * @param id (required)
     * @return Successful operation (status code 200)
     * or User not found (status code 404)
     */
    @Override
    public ResponseEntity<User> usersIdGet(Long id) {
        User user = new User("李四", "lisi@163.com");
        return ResponseEntity.ok(user);
    }

    /**
     * PUT /users/{id} : Update user
     * Updates an existing user
     *
     * @param id   (required)
     * @param user (required)
     * @return User updated (status code 200)
     * or User not found (status code 404)
     */
    @Override
    public ResponseEntity<User> usersIdPut(Long id, User user) {
        return null;
    }

    /**
     * POST /users : Create a new user
     * Creates a new user
     *
     * @param user (required)
     * @return User created (status code 201)
     */
    @Override
    public ResponseEntity<User> usersPost(User user) {
        return null;
    }
}
